<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>trend</title>
    <script src="/js/app.js"></script>
    <style>
        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
            width: 100%;
        }
    </style>
</head>
<body>
<div id="echarts" style="width:100%;height:100%"></div>
<script src="/js/echarts.min.js"></script>
<script>
    var columnNames =  <?php echo json_encode($columnNames); ?>;
    var date = <?php echo json_encode($date); ?>;
    var series = <?php echo json_encode($series); ?>;
    var min = <?php echo json_encode($min); ?>;
    var max = <?php echo json_encode($max); ?>;
    $(() => {
        const myChart = echarts.init(document.getElementById('echarts'));
        let option = {
            title: {
                text: 'title',
            },
            tooltip: {
                trigger: 'axis'
            },
            color: ["#FF0000", "#00BFFF", "#FF00FF", "#1ce322", "#000000", '#EE7942'],
            legend: {
                data: columnNames
//                data:['noncommercial_long','noncommercial_short']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: date
            },
            yAxis: [{
                type: 'value',
                axisLabel: {
                    formatter: '{value} '
                },
                min: min,
                max: max,
            }],
            dataZoom: [{
                type: 'inside',
                start: 50,
                end: 100
            }, {
                show: true,
                type: 'slider',
                y: '90%',
                start: 50,
                end: 100
            }],
            series:series
//            series: [{
//                name: '誉达⑨号',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 0.999640152, 0.991376156, 0.991304479, 1.00791442, 1.015577654, 1.008748035, 1.015754465, 1.022747704, 1.016893643, 1.030048136, 1.025649791, 1.03387254, 1.041602688, 1.013560119, 1.021460948, 1.021693316, 1.014965612, 1.015323078, 1.007790707, 1.011034404, 1.023869485, 1.026184226, 1.029289754, 1.034968142, 1.030753965, 1.033297364, 1.005880007, 1.001874395, 1.006538838, 1.018751113, 1.024749662, 1.018532109, 1.014253021, 1.012709638, 1.016759492, 1.01590511, 1.016932148, 1.027661566, 1.024013947, 1.025474615, 1.024451769, 1.017142543, 1.015919229, 1.018497738, 1.016376915, 1.016566398, 1.010498552, 0.983156315,]
//            }, {
//                name: '上证指数',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 1.001720677, 1.003086907, 0.999313663, 1.006351037, 1.010742952, 1.012605408, 1.014860976, 1.017960772, 1.011838514, 1.017255102, 1.01600165, 1.020477343, 1.025697374, 1.030053844, 1.036543437, 1.036894662, 1.035302875, 1.040661462, 1.031787409, 1.043993259, 1.048301396, 1.050843744, 1.047673059, 1.048333618, 1.040352127, 1.044563596, 1.046239161, 1.040793574, 1.037017107, 1.042030914, 1.044782708, 1.044218816, 1.036514437, 1.035228763, 1.04304592, 1.043790258, 1.044573262, 1.053331314, 1.043184477, 1.047489391, 1.050969411, 1.045688158, 1.046761164, 1.053495648, 1.05269331, 1.04817895, 1.044428262, 1.034416758,]
//            }, {
//                name: '深证指数',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 1.01173606, 1.009467919, 1.005741908, 1.019905691, 1.027117824, 1.023551396, 1.027300058, 1.034928136, 1.03006754, 1.037675027, 1.035290544, 1.042965983, 1.048382547, 1.04875834, 1.057453052, 1.056844576, 1.047818343, 1.055716168, 1.049946462, 1.063442056, 1.071344, 1.075321226, 1.074112511, 1.075254304, 1.065969648, 1.06986039, 1.072669055, 1.067386336, 1.070494605, 1.08334157, 1.086415864, 1.080873692, 1.07292027, 1.07600383, 1.08721275, 1.084314513, 1.085475867, 1.09385759, 1.082634256, 1.084376287, 1.089965818, 1.086558974, 1.089597233, 1.096153529, 1.089481921, 1.087563833, 1.083191253, 1.065426036,]
//            }, {
//                name: '沪深300',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 1.00208167, 1.006000994, 1.002964347, 1.010676467, 1.013444998, 1.013556463, 1.017005829, 1.020638961, 1.013568513, 1.016195454, 1.013927006, 1.019232102, 1.023148413, 1.028329994, 1.03519559, 1.035050987, 1.030806308, 1.036596424, 1.030724969, 1.045772643, 1.049215985, 1.051306692, 1.046354065, 1.04651373, 1.038190062, 1.04017533, 1.041871394, 1.034840109, 1.032659025, 1.038268388, 1.040521773, 1.038946211, 1.03238187, 1.032668062, 1.041768968, 1.041344199, 1.043437919, 1.048821341, 1.038066547, 1.039211315, 1.044254319, 1.039343867, 1.042937836, 1.051258492, 1.047775987, 1.045296661, 1.043904864, 1.035340192,]
//            }, {
//                name: '创业板指',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 1.020220116, 1.008160144, 1.007258923, 1.0272551, 1.030843597, 1.016587924, 1.021765846, 1.030248245, 1.025075784, 1.03801513, 1.031832209, 1.039752028, 1.045459759, 1.040325532, 1.045241281, 1.042903569, 1.033596417, 1.036474861, 1.028413032, 1.035016522, 1.04928312, 1.048676844, 1.051943087, 1.058765054, 1.052390966, 1.052603982, 1.055231177, 1.048911708, 1.053221181, 1.072053964, 1.080290575, 1.073069886, 1.067231068, 1.065084524, 1.076483601, 1.069459541, 1.069350302, 1.074216894, 1.064893356, 1.067165524, 1.071119972, 1.064303466, 1.064188765, 1.073348445, 1.063729961, 1.061998525, 1.053718218, 1.034328317,]
//            }, {
//                name: '中小板指',
//                type: 'line',
//                lineStyle: {
//                    normal: {
//                        width: 2,
//                    }
//                },
//                data: [1, 1.011114636, 1.009665113, 1.006429309, 1.019300943, 1.0243214, 1.020861091, 1.024965633, 1.031647104, 1.030700277, 1.038191919, 1.035035831, 1.043583299, 1.048541936, 1.048062016, 1.057401759, 1.058263989, 1.049163393, 1.05729764, 1.051831426, 1.06497637, 1.073193587, 1.078425535, 1.078254716, 1.079458584, 1.073746716, 1.077885421, 1.080322442, 1.077594215, 1.086618349, 1.0985155, 1.100015455, 1.093303074, 1.086128668, 1.092935406, 1.107586813, 1.104902511, 1.104113489, 1.112755314, 1.099717742, 1.100087036, 1.106392705, 1.103993102, 1.107879646, 1.116217249, 1.111078032, 1.108092763, 1.105240896, 1.08621001,]
//            }]
        };
        myChart.setOption(option);
        setTimeout(() => {
            window.onresize = () => {
                myChart.resize();
            }
        }, 500);
    })
    ;

</script>
</body>

</html>